import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
    plugins: [vue()],
    server: {
        host: 'localhost',
        port: 8088,
        proxy: {
            "/foo": 'http://localhost:8082',
            // 选项写法
            '/api': {
                target: 'http://localhost:8082',
                //跨域请求
                changeOrigin: true,
                // rewrite 写
                rewrite: (path) => path.replace(/^\/api/, '')
            }
        }
    }
})